Conversation
BridgeAR
left a comment
There was a problem hiding this comment.
This seems like a very good idea and I am in strong favor of this!
(Not only because of the name, but also because of the change ;-) )
That aside: it should be checked what runtimes are supported. Lambda currently supports Node.js 20 as lowest version, if I am not mistaken (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). That supports ES2023.
tsconfig.json
Outdated
| /* Basic Options */ | ||
| // "incremental": true, /* Enable incremental compilation */ | ||
| "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, | ||
| "target": "es2017" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, |
There was a problem hiding this comment.
Node.js 18 supports ES2021 and that is already an outdated version. I think we should target nothing less than ES2020, if not 2021.
There was a problem hiding this comment.
I set "es2021" to match the list of supported engines in the README.md
|
@rubenpad do you mind rebasing the PR after activating commit signing? We may not merge any unsigned commits (a merge therefore also does not resolve that, the current existing commits on the branch must be signed) |
Hey! This is my first PR to this project. Please let me know if I did something wrong in the process. Thanks!
What does this PR do?
This PR updates the tsconfig target to at es2017.
Motivation
For tsconfig targets below es2017 the async/await syntax is compiled to the generator-based syntax with the __awaiter / __generator helpers. This change reduce the output size and improves the runtime performance.
Testing Guidelines
I ran the tests suite.
Additional Notes
After switching the TypeScript target to es2017, let declarations are preserved instead of being downleveled to var. This exposes correct block-scoping and temporal dead zone (TDZ) behavior that was previously masked by hoisting.
Some tests relied on the old hoisted behavior, so they have been updated to avoid accessing let variables before initialization. These changes align the test suite with real ES2017 runtime semantics without altering the intent of the tests.
Types of Changes
Check all that apply